<style>
    .modal-content {
        width: 1350px;
        right: 380px;
    }
</style>
<section class="content">
    <div class="row">
        <div class="col-xs-12">
            <div class="box">
                <div class="box-header">
                    <h4>ucloud初始化脚本维护</h4>
                    <div class="col-xs-2">
                        <input type="text" ng-model="info.schemaInfo" placeholder="选择数据库"
                               uib-typeahead="schema as schema.table_schema for schema in info.schemaList | filter:{table_schema:$viewValue}|limitTo:15"
                               typeahead-template-url="projectTemplate.html" class="form-control"
                               typeahead-show-hint="true" typeahead-min-length="0" typeahead-on-select="schemaSelect();"
                               typeahead-select-on-blur="true">
                    </div>
                    <div class="col-xs-2">
                        <select class="form-control" ng-model="info.envType" ng-change="schemaSelect();">
                            <option value="DEVTEST">DEVTEST</option>
                            <option value="STAGING">STAGING</option>
                            <option value="DEMO_SANDBOX">DEMO_SANDBOX</option>
                        </select>
                    </div>
                </div>
                <div class="box-body" style="height: 700px;overflow-y: auto;">
                    <table class="table table-hover table-bordered text-center">
                        <thead>
                        <tr>
                            <th>
                                数据库
                            </th>
                            <th>
                                数据库实例
                            </th>
                            <th>
                                脚本
                            </th>
                            <th>
                                备注
                            </th>
                            <th>
                                有效
                            </th>
                            <th>
                                创建人
                            </th>
                            <th>
                                创建时间
                            </th>
                            <th>
                                更新人
                            </th>
                            <th>
                                更新时间
                            </th>
                            <th>
                                操作
                            </th>
                        </tr>
                        </thead>
                        <tbody>
                        <tr ng-repeat="i in info.initList">
                            <td>
                                {{i.table_schema}}
                            </td>
                            <td>
                                <input type="text" ng-model="i.table_schema_instance" style="width: 150px;"/>
                            </td>
                            <td>
                                <textarea style="width: 520px; height: 520px;"
                                          ng-model="i.script"></textarea>
                            </td>
                            <td>
                                <textarea style="width: 260px; height: 96px;"
                                          ng-model="i.remark"></textarea>
                            </td>
                            <td>
                                <span ng-if="i.is_active == 'Y' ">
                                        <a href="javascript:void(0)" ng-click="changeActive(i,'N');"
                                           style="color: #00a65a;"
                                           class="btn-link" type="button">
                                            有效
                                        </a>
                                    </span>
                                <span ng-if="i.is_active != 'Y' ">
                                        <a href="javascript:void(0)" ng-click="changeActive(i,'Y');"
                                           style="color: #c9302c;"
                                           class="btn-link" type="button">
                                            无效
                                        </a>
                                    </span>
                            </td>
                            <td>
                                {{i.createdby}}
                            </td>
                            <td>
                                {{i.created | date:'yyyy-MM-dd HH:mm:ss'}}
                            </td>
                            <td>
                                {{i.updatedby}}
                            </td>
                            <td>
                                {{i.updated | date:'yyyy-MM-dd HH:mm:ss'}}
                            </td>
                            <td>
                                <button class="btn btn-warning" type="button" ng-click="save(i)">保存</button>
                            </td>
                        </tr>
                        </tbody>
                    </table>
                </div>
            </div>
        </div>
    </div>
</section>
<script type="text/ng-template" id="projectTemplate.html">
    <a>
        <span ng-bind-html="match.label | uibTypeaheadHighlight:query"></span>
    </a>
</script>